<template>
  <div class="container">
    <!-- 面包屑导航 -->
    <div class="breadcrumb">
      <el-breadcrumb separator="">
        <el-breadcrumb-item>
          <div class="div1">商品管理</div>
        </el-breadcrumb-item>
        <el-breadcrumb-item>
          <div class="div2">销售属性</div>
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <!-- 面包屑导航 -->
    <div class="Box">
      <div class="table_tab">
        <div class="inquiry">
          <div class="headerbox">
            <div class="header">
              <div class="title_left"></div>
              销售属性
            </div>
            <div class="headerbox_right">
              <!-- <el-button size="mini" type="primary" @click="refresh()"
                >刷新</el-button
              > -->
              <!-- <el-button size="mini" @click="back()">返回</el-button> -->
            </div>
          </div>
          <div class="headerTitle">数据筛选</div>
          <el-form
            :inline="true"
            ref="queryForm"
            :model="queryForm"
            label-width=""
            size="mini"
          >
            <el-form-item label="规格名称">
              <el-input
                placeholder="请输入类目名称"
                clearable
                :maxlength="20"
                v-model.trim="queryForm.name"
              ></el-input>
            </el-form-item>
            <el-form-item label="规格编号">
              <el-input
                placeholder="请输入编号"
                clearable
                v-model.trim="queryForm.specNo"
                oninput ="value=value.replace(/[^0-9.]/g,'')"
              ></el-input>
            </el-form-item>
            <el-form-item label="所属类目：">
              <el-cascader
                clearable
                v-model="queryForm.categoryId"
                :options="categoryOptions"
                :props="{
                  label: 'categoryName',
                  value: 'id',
                  checkStrictly: true,
                }"
                filterable
                @change="handleChangeSearch"
              ></el-cascader>
            </el-form-item>
            <el-form-item label="状态">
              <el-select
                v-model="queryForm.status"
                placeholder="请选择"
                clearable
                @change="selectState"
              >
                <el-option
                  v-for="item in dictionaries.enable_status"
                  :key="item.dictId"
                  :label="item.dictName"
                  :value="item.dictId"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-button
                @click="searchEvent()"
                plain
                v-on:keyup.enter="searchEvent"
                type="primary"
                >搜索</el-button
              >
              <el-button plain @click="reset()" type="primary">重置</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div class="inquiryTab">
          <div class="inquiryTab_header">
            <div class="tabTitle">列表数据</div>
            <el-button
              @click="addClassify('add')"
              type="primary"
              v-if="parArray.indexOf('addMarketCode') != -1"
              style="width: 120px; height: 36px; line-height: 11px"
              >新 增</el-button
            >
          </div>
          <div class="table">
            <el-table
              :data="tableData.list"
			  v-loading="loading"
              :header-cell-style="{ background: '#f8f8f8' }"
              style="width: 100%"
            >
              <el-table-column label="规格编号" prop="specNo">
                <template slot-scope="props">
                  {{ props.row.specNo }}
                </template>
              </el-table-column>
              <el-table-column label="规格名称" prop="name"> </el-table-column>

              <el-table-column label="所属类目" prop="categoryNameList">
              </el-table-column>
              <el-table-column label="子规格" prop="itemCount">
                <template slot-scope="props">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="props.row.list"
                    placement="top"
                  >
                    <span style="color: #4168e7; cursor: pointer">{{
                      props.row.itemCount
                    }}</span>
                  </el-tooltip>
                </template>
              </el-table-column>
              <el-table-column label="状态" prop="status">
                <template slot-scope="props">
                  <p :class="props.row.status == 1 ? 'green' : 'red'">
                    {{ props.row.statusLabel }}
                  </p>
                </template>
              </el-table-column>
              <el-table-column
                label="最后编辑时间"
                prop="updatedTime"
              ></el-table-column>
              <el-table-column label="操作" fixed="right">
                <template slot-scope="props">
                  <p
                    class="btnp"
                    @click="setState(props.row)"
                    v-if="
                      props.row.status == 2 &&
                      parArray.indexOf('enableMarket') != -1
                    "
                  >
                    启用
                  </p>
                  <p
                    class="btnp"
                    @click="setState(props.row)"
                    v-if="
                      props.row.status == 1 &&
                      parArray.indexOf('forbiddenMarket') != -1
                    "
                  >
                    禁用
                  </p>
                  <p
                    v-if="parArray.indexOf('editMarketCode') != -1"
                    class="btnp"
                    @click="antiShake('edit', props.row)"
                  >
                    编辑
                  </p>

                  <p
                    v-if="parArray.indexOf('copyProperty') != -1"
                    class="btnp"
                    @click="copy('copy', props.row)"
                  >
                    复制
                  </p>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>
    </div>
    <!-- 分页start -->
    <div class="page">
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNo"
          :page-sizes="[10, 20, 50, 100, 200]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="tableData.totalNum"
          prev-text="上一页"
          next-text="下一页"
        >
        </el-pagination>
      </div>
    </div>
    <!-- 分页end -->
    <!-- 新增规格对话框 -->
    <el-dialog
      :title="dialog.title"
      :close-on-click-modal="false"
      append-to-body
      :visible.sync="dialog.visible"
      width="700px"
      :before-close="handleCloseAddClassify"
    >
      <el-form ref="form" :rules="rules" :model="form" label-width="100px">
        <el-form-item label="规格编号：" prop="specNo">
          <el-input
            placeholder="请输入规格编号"
            :maxLength="20"
            type="text"
            @input="v=> form.specNo = v.replace(/[^\d]/g,'')"
            v-model="form.specNo"
            style="width: 100%"
          ></el-input>
        </el-form-item>
        <el-form-item label="规格名称：" prop="name">
          <el-input
            placeholder="请输入规格名称"
            v-model.trim="form.name"
            :maxlength="20"
            show-word-limit
          ></el-input>
        </el-form-item>
        <el-form-item label="所属类目：" prop="categoryIdList">
          <el-cascader
            placeholder="请选择三级类目"
            style="width: 100%"
            v-model="form.categoryIdList"
            :options="categoryOptions"
            :props="{
              label: 'categoryName',
              value: 'id',
              multiple: true,
            }"
            collapse-tags
            clearable
            @change="handleCategory"
          ></el-cascader>
        </el-form-item>
        <span style="margin-left: 100px"
          >规格值<span style="color: #4168e7; padding-left: 10px"
            >(已选{{ dynamicTags.length }})</span
          ></span
        >
        <el-form-item prop="list" label="商品规格：">
          <el-tag
            :key="tag"
            v-for="tag in dynamicTags"
            closable
            :disable-transitions="false"
            @close="handleClose(tag)"
          >
            {{ tag }}
          </el-tag>
          <el-input
            class="input-new-tag"
            v-if="inputVisible"
            v-model="form.itemList"
            ref="saveTagInput"
            size="small"
            @keyup.enter.native="handleInputConfirm"
            @blur="handleInputConfirm"
          >
          </el-input>
          <el-button
            v-else
            class="button-new-tag"
            size="small"
            @click="showInput"
            >+ 继续添加</el-button
          >
        </el-form-item>
        <el-form-item label="状态：" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio
              v-for="(item, index) in dictionaries.enable_status"
              :label="item.dictId"
              :key="index"
              >{{ item.dictName }}</el-radio
            >
          </el-radio-group>
        </el-form-item>

        <div style="float: right; margin-bottom: 25px">
          <el-button @click="dialog.visible = false" class="dialogbtn"
            >取消</el-button
          >
          <el-button
            type="primary"
            class="dialogbtntoo"
            @click="classifyAdd('form')"
            >确定</el-button
          >
        </div>
      </el-form>
    </el-dialog>
    <!-- 新增分类对话框结束 -->
  </div>
</template>

<script>
import VDistpicker from 'v-distpicker'
export default {
  watch: {

  },
  components: {
    VDistpicker
  },
  data () {
    return {
      // 新增规格
      form: {
        id: '', //	int	主键id
        specNo: '', //	string	规格编号
        name: '', //	string	规格名称
        categoryIdList: [], //	string	规格类目
        itemList: '', //	int	子规格
        status: '', //	string	状态
        statusLabel: '', //	string	状态（字典分组：enable_status）
        updatedTime: '', //	string	最后编辑时间
        list: ''
      },
      idDisabled: false, // 防抖使用
      tableData: [],
	  loading:false,
      dynamicTags: [],
      inputVisible: false,
      inputValue: '',
      addBrand: [],
      propertyDetails: [], // 销售属性详情

      date: '',
      rowId: '', // 列表行ID
      rowList: [],
      selectedOptions: [],

      options: [],
      btnText: '',
      queryForm: {
        name: '', // 规格名称
        specNo: '', // 规格编号
        categoryId: '', // 类目id
        status: ''// 状态
      },
      // 列表树形控件配置参数
      defaultProps: {
        children: 'children',
        categoryName: 'categoryName'
      },
      cascaderValue: '',
      rules: {
        specNo: [
          { required: true, message: '请输入规格编号', trigger: 'blur' },
          { message: '长度在 1 到 20 个数字', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '请输入规格名称', trigger: 'blur' },
          { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
        ],
        categoryIdList: [
          { required: true, message: '请选择所属类目', trigger: 'change' }
        ],
        list: [
          { required: true, message: '请输添加商品规格', trigger: 'blur' }
        ],
        status: [
          { required: true, message: '请选择状态', trigger: 'change' }
        ]
      },
      forbidden: false, // 是否禁用
      pageNo: 1,
      pageSize: 10,
      tree: [],
      orgCode: '',
      limits: '',
      parArray: [],
      height: '500px',

      expandRow: [],
      categoryOptions: [], // 类目下拉数据
      dictionaries: { // 字典数据
        enable_status: [] // 状态
      },
      dialog: { visible: false, title: '', type: '' },
      lastTime: 0 // 默认上一次点击时间为0
    }
  },
  mounted () {

  },
  created () {
    this.getCategoryDate()// 类目数据
    this.getDataList()
    // 获取字典数据
    for (const type in this.dictionaries) { this.getDictionaries(type) }

    // 权限设定判断
    this.limits = JSON.parse(sessionStorage.getItem('limit'))
    const params = this.limits.buttonTreeDto.filter(
      (item) => item.menuCode === 'marketAttributeCode'// 菜单管理里面的菜单编码
    )
    params[0].buttonList.forEach((item) => {
      this.parArray.push(item.code)
    })
    // 权限设定判断
    document.onkeydown = (e) => {
      const key = window.event.keyCode
      if (key == 13) {
        this.searchEvent()
      }
    }
  },
  beforeRouteLeave (to, form, next) {
    document.onkeydown = null
    next()
  },

  methods: {
    // 分页
    handleCurrentChange (val) {
      this.pageNo = val
      this.getDataList()
    },
    handleSizeChange (val) {
      this.pageSize = val
      this.getDataList()
    },
    // 类目搜索
    handleChangeSearch (e) {
      if (e.length > 1) {
        this.queryForm.categoryId = e[e.length - 1]
      } else {
        this.queryForm.categoryId = e
      }
    },
    // 新增规格弹框所属类目选择值
    handleCategory (e) {
    },

    // 类目数据
    getCategoryDate () {
      const params = {
        pageSize: 10000,
        notShowChasm: 1
      }
      this.$api.brandDate(params).then((res) => {
        if (res.code == 0) {
          this.categoryOptions = res.data.list
        }
      }).catch((err) => { console.log(err) })
    },
    // 获取状态字典数据
    getDictionaries (type) {
      if (type && this.dictionaries[type].length > 0) { return }
      const params = { groupId: type }
      this.$api.dictionaries(params).then((res) => {
        this.dictionaries[type] = res.data
      }).catch((err) => {
        console.log(err)
      })
    },
    // 列表数据
    getDataList (type) {
		this.loading = true;
      const data = {
        name: this.queryForm.name,
        specNo: this.queryForm.specNo,
        categoryId: this.queryForm.categoryId.toString(),
        status: this.queryForm.status,
        pageNo: this.pageNo,
        pageSize: this.pageSize
      }
      this.$api.salesPecPageList(data).then((res) => {
        if (res.code == 0) {
          res.data.list.forEach((res) => {
            let dataList = ''
            res.itemList.forEach((item) => {
              dataList = `${dataList + item.content + '、'}`
            })
            if (dataList) {
              dataList = dataList.slice(0, dataList.length - 1)
            }
            res.list = dataList

            // res.statusChin = this.dictionaries.enable_status.find((e) => {
            //   return e.dictId == res.status
            // }).dictName
          }
          )

          this.tableData = res.data
        }
		this.loading = false;
      })
    },

    antiShake (type, row) {
      const that = this
      // 获取当前时间的时间戳
      const now = new Date().valueOf()
      // 第一次点击
      if (this.lastTime == 0) {
        that.getSalesPecDetail(type, row)
        that.lastTime = now
      } else {
        if ((now - that.lastTime) > 2000) {
          // 重置上一次点击时间，2000是我自己设置的2秒间隔，根据自己的需要更改
          that.lastTime = now
          that.getSalesPecDetail(type, row)

          // 添加自己要调用的方法
        } else {
          console.log('不触发')
        }
      }
    },
    // 销售属性详情查询
    getSalesPecDetail (type, row) {
      this.propertyDetails = []
      this.dynamicTags = []
      this.idDisabled = true
      const data = {
        id: row.id
      }
      this.$api.salesPecDetail(data).then((res) => {
        if (res.code == 0) {
          this.propertyDetails = res.data
          this.propertyDetails.itemList.forEach((res) => {
            this.dynamicTags.push(res.content)
          })
          let data = []

          if (res.data.categoryList) {
            data = res.data.categoryList.map((res) => {
              const arr = []
              res.forEach(item => {
                if (item.id) {
                  arr.push(item.id)
                }
              })
              return arr
            })
          }
          if (type == 'edit') {
            this.form.categoryIdList = data
            this.dialog.type = 'edit'
            this.dialog.visible = true
            this.dialog.title = '编辑规格'
            this.form.list = this.dynamicTags.map(e => ({
              content: e
            }))
            this.form.id = this.propertyDetails.id
            this.form.specNo = this.propertyDetails.specNo
            this.form.name = this.propertyDetails.name
            this.form.status = this.propertyDetails.status + ''
            this.$nextTick(() => {
              this.$refs['form'].clearValidate()
            })
          } else {
            this.form.categoryIdList = data
            this.dialog.type = 'copy'
            this.dialog.visible = true
            this.dialog.title = '复制'
            this.form.list = this.dynamicTags.map(e => ({
              content: e
            }))
            this.form.id = this.propertyDetails.id
            this.form.specNo = this.propertyDetails.specNo
            this.form.name = this.propertyDetails.name
            // this.form.categoryIdList = this.propertyDetails.categoryIdList
            this.form.status = this.propertyDetails.status + ''
            this.$nextTick(() => {
              this.$refs['form'].clearValidate()
            })
          }
        }
      }).catch((err) => { console.log(err) })
    },
    // 新增销售属性
    addClassify (type, row) {
      if (type == 'add') {
        this.dialog.type = 'add'
        this.dialog.title = '新增规格'
        this.form = {
          id: '', //	int	主键id
          specNo: '', //	string	规格编号
          name: '', //	string	规格名称
          categoryIdList: [], //	string	规格类目
          itemList: '', //	int	子规格
          status: '', //	string	状态
          statusLabel: '', //	string	状态（字典分组：enable_status）
          updatedTime: '', //	string	最后编辑时间
          list: ''
        },
        this.dialog.visible = true

        this.dynamicTags = []
        this.$nextTick(() => {
          this.$refs['form'].clearValidate()
        })
      }
    },

    // 新增规格提交
    classifyAdd (formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.dialog.type == 'add') {
            this.addBrand = []
            this.form.categoryIdList.map((item) => {
              if (item.length >= 3) {
                this.addBrand.push(item[item.length - 1])
              }
            })
            const data = {
              id: this.form.id, //	int	主键id
              specNo: this.form.specNo, //	string	规格编号
              name: this.form.name, //	string	规格名称
              categoryIdList: this.addBrand, //	string	规格类目
              itemList: this.form.list, //	int	子规格
              status: this.form.status, //	string	状态
              statusLabel: this.form.statusLabel, //	string	状态（字典分组：enable_status）
              updatedTime: this.form.updatedTime //	string	最后编辑时间
            }
            this.$api.salesPecAdd(data).then((res) => {
              if (res.code == 0) {
                this.$message.success('新增成功！')
                this.dialog.visible = false
                this.getDataList()
              } else {
                this.$message.error('新增失败！')
              }
            }).catch((err) => { console.log(err) })
          } else
          if (this.dialog.type == 'edit') {
            this.addBrand = []
            this.form.categoryIdList.map((item) => {
              if (item.length >= 3) {
                this.addBrand.push(item[item.length - 1])
              }
            })
            const data = {
              id: this.form.id, //	int	主键id
              specNo: this.form.specNo, //	string	规格编号
              name: this.form.name, //	string	规格名称
              categoryIdList: this.addBrand, //	string	规格类目
              itemList: this.form.list, //	int	子规格
              status: this.form.status, //	string	状态
              statusLabel: this.form.statusLabel, //	string	状态（字典分组：enable_status）
              updatedTime: this.form.updatedTime //	string	最后编辑时间
            }
            this.$api.salesPecEdit(data).then(res => {
              if (res.code == 0) {
                this.$message.success('编辑成功！')
                this.dialog.visible = false
                this.getDataList()
              }
            }).catch(err => { console.log(err) })
          } else {
            this.addBrand = []
            this.form.categoryIdList.map((item) => {
              if (item.length >= 3) {
                this.addBrand.push(item[item.length - 1])
              }
            })
            const data = {
              // id: this.form.id,//	int	主键id
              specNo: this.form.specNo, //	string	规格编号
              name: this.form.name, //	string	规格名称
              categoryIdList: this.addBrand, //	string	规格类目
              itemList: this.form.list, //	int	子规格
              status: this.form.status, //	string	状态
              statusLabel: this.form.statusLabel, //	string	状态（字典分组：enable_status）
              updatedTime: this.form.updatedTime //	string	最后编辑时间
            }
            this.$api.salesPecAdd(data).then(res => {
              if (res.code == 0) {
                this.$message.success('复制成功！')
                this.dialog.visible = false
                this.getDataList()
              }
            }).catch(err => { console.log(err) })
          }
        } else {
          return false
        }
      })
    },

    // 弹框内标签相关
    handleClose (tag) {
      this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
      this.form.list = this.dynamicTags.map(e => ({
        content: e
      }))
    },

    showInput (e) {
      this.inputVisible = true
      this.$nextTick(_ => {
        this.$refs.saveTagInput.$refs.input.focus()
      })
    },
    // 标签填写值
    handleInputConfirm (e) {
      const inputValue = this.form.itemList

      if (inputValue) {
        this.dynamicTags.push(inputValue)
      }
      this.inputVisible = false
      this.form.itemList = ''

      this.form.list = this.dynamicTags.map(e => ({
        content: e
      }))
    },

    // 弹框内标签相关结束
    selectState (e) {
      this.queryForm.status = e
    },
    handleCloseAddClassify () {
      this.dialog.visible = false
    },
    // 启用/禁用
    setState (e) {
      if (e.status == 1) { // 禁用
        this.$confirm('是否确定禁用该类目？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const params = {
            id: e.id
          }
          this.$api.salesPecDisable(params).then((res) => {
            if (res.code == 0) {
              this.$message.success('禁用成功')
              this.getDataList()
            }
          }).catch((err) => { console.log(err) })
        }).catch(() => {
        })
      } else { // 启用
        this.$confirm('是否确定启用该类目？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          const params = {
            id: e.id
          }
          this.$api.salesPecEnable(params).then((res) => {
            if (res.code == 0) {
              this.$message.success('启用成功')
              this.getDataList()
            }
          }).catch((err) => { console.log(err) })
        }).catch(() => {
        })
      }
    },

    // 复制
    copy (type, row) {
      this.$confirm('是否复制该条规格数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (type == 'copy') {
          this.getSalesPecDetail('copy', row)
        }
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消复制'
        })
      })
    },
    handleNodeClick (e) {
    },

    handleSelectPositionId (e) {
      this.queryForm.positionId = e
    },

    // 刷新
    refresh () {
      this.queryForm = {}
      this.queryForm.orgId = ''
      this.$forceUpdate()
    },
    // 返回
    back () {
      this.$router.go(-1)
    },
    filterNode (value, data) {
      if (!value) return true
      return data.orgName.indexOf(value) !== -1
    },

    is_null (content) {
      if (content) {
        return false
      } else {
        return true
      }
    },

    /** *是否正常下拉框的数据请求***/
    /** *重置搜索***/
    reset () {
      this.queryForm = {
        name: '', // 规格名称
        specNo: '', // 规格编号
        categoryId: '', // 类目id
        status: ''// 状态
      },
      this.pageSize = 10
      this.pageNo = 1
      this.getDataList()
    },
    /** *搜索模拟数据***/
    searchEvent () {
      this.pageSize = 10
      this.pageNo = 1
      this.getDataList('search')
    },
    /** *搜索模拟数据***/
    forArr (arr, isExpand) { // 展开树形表格
      arr.forEach(i => {
        this.$refs.theTable.toggleRowExpansion(i, isExpand)
        if (i.children) {
          this.forArr(i.children, isExpand)
        }
      })
    }

  }
}
</script>
<style scoped lang="scss">
.div1 {
  margin-left: -16px;
  background: url(../../assets/breadcrumb2.png);
  width: 120px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #2d7edf;
}
.div2 {
  margin-left: -16px;
  background: url(../../assets/breadcrumb1.png);
  width: 120px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  color: #fff;
}
// 弹框内标签相关
.el-tag + .el-tag {
  margin-left: 10px;
}
.el-tag {
  background-color: #fff;
  color: #333;
  border-color: #d9d9d9;
  font-size: 14px;
}

.button-new-tag {
  margin-left: 10px;
  margin-bottom: 4px;
  height: 33px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  width: 150px;
  background-color: #e3edff;
  border: none;
  color: #4168e7;
}
.input-new-tag {
  width: 150px;
  margin-left: 10px;
  vertical-align: bottom;
}
// 弹框内标签相关结束
.el-menu-vertical-demo {
  width: 200px;
  overflow-y: scroll;
  height: 700px;
}
.el-menu-input {
  padding: 0 15px;
  background: #fff;
  /deep/ .el-input__inner {
    height: 30px;
    border: 1px solid #eee;
    margin: 10px 0;
  }
}
.el-menu-vertical-demo::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.btnp {
  display: inline-block;
  vertical-align: middle;
  padding: 0 10px;
  color: #0083ef;
}
.btnp:hover {
  color: #4168e7;
  cursor: pointer;
}
.Box {
  display: flex;
  justify-content: flex-start;
  width: 100%;

  .table_tab {
    width: 100%;
    margin-bottom: 50px;
  }
}
.table {
  border-radius: 5px;
  width: 100%;
}
/deep/.distpicker-address-wrapper select {
  padding: 0rem 0.75rem;
  height: 30px;
  line-height: 30px;
  font-size: 15px;
}

/deep/ .expanded {
  background: #f5f7fa;
  color: #000;
}

/deep/.el-table__expanded-cell[class*="cell"] {
  padding: 0px 50px;
}
/deep/.el-table td,
.el-table th {
  text-align: center;
}
.header {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-family: PingFang SC;
  font-weight: bold;
  color: #333333;
  padding-bottom: 10px;
}

.inquiry {
  background: #fff;
  padding: 10px 20px 10px 20px;
  border-radius: 5px;
  .el-form {
    margin-top: 10px;
  }
}
.inquiryTab {
  background: #fff;
  padding: 10px 20px 20px 20px;
  border-radius: 5px;
  .el-form {
    margin-top: 10px;
  }
  margin-top: 20px;
  .inquiryTab_header {
    display: flex;
    justify-content: space-between;
    /deep/ .el-button {
      height: 40px;
    }
  }
}

/deep/.el-table__expand-icon > .el-icon {
  color: transparent;
}

.table {
  margin-top: 10px;
  border: 1px solid #e8eaec;
  border-radius: 0;
  /deep/ .el-input--suffix .el-input__inner {
    background: #409eff;
    color: #fff;
    width: 104px;
    box-shadow: none;
  }
  /deep/ .el-button {
    padding: 10px 13px;
  }
}

.page {
  text-align: right;
  width: 100%;
  background: #f5f5f5;
  padding-right: 30px;
  position: fixed;
  bottom: 0px;
  right: 0px;
  z-index: 5;

  span {
    font-size: 14px;
    color: #666;
    display: inline-block;
    margin-left: 10px;
  }
  .el-pagination {
    display: inline-block;
    vertical-align: middle;
  }
}
.demo-table-expand {
  font-size: 0;
}
.demo-table-expand label {
  width: 200px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
  text-align: left;
}
/deep/.el-table__row:hover {
  color: rgb(45, 125, 223);
}
/deep/.el-dialog__header {
  padding: 20px 20px 20px 20px;
  border-bottom: 1px solid #d9d9d9;
  font-family: PingFang SC;
  font-weight: bold;
  line-height: 25px;
  color: #333333;
}
/deep/.el-dialog {
  border-radius: 10px;
}
/deep/.el-dialog__headerbtn {
  top: 15px;
}
.headerbox {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-bottom: 1px solid #ededed;
  padding-bottom: 10px;
}
.title_left {
  width: 4px;
  height: 16px;
  background: #4c81eb;
  opacity: 1;
  margin-right: 10px;
}
.tabTitle {
  font-size: 18px;
  font-family: PingFang SC;
  font-weight: 400;
  line-height: 25px;
  color: #333333;
  opacity: 1;
  margin-top: 10px;
  margin-bottom: 10px;
}
.headerTitle {
  font-size: 18px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
  opacity: 1;
  margin-top: 20px;
  margin-bottom: 15px;
}
/deep/.el-form-item__label {
  font-size: 14px;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
}
.red {
  color: #ff0000;
}
.green {
  color: #67c23a;
}

/deep/.el-input.is-disabled .el-input__inner {
  background-color: #fff;
  font-family: PingFang SC;
  font-weight: 400;
  color: #333333;
}
/deep/ .el-dialog__footer {
  border-top: 1px solid #d9d9d9;
  margin-top: -20px;
  padding-top: 20px;
}
/deep/.el-table thead {
  font-size: 16px;
  font-family: PingFang SC;
  font-weight: bold;
  line-height: 22px;
  color: #333333;
  opacity: 1;
}
.dialogbtn {
  width: 120px;
  height: 36px;
  border: 1px solid #d9d9d9;
  opacity: 1;
  border-radius: 4px;
  line-height: 0px;
}
.dialogbtntoo {
  width: 120px;
  height: 36px;
  background: #4168e7;
  opacity: 1;
  line-height: 0px;
  border-radius: 4px;
}
</style>
